﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Domain.Entities;

namespace Himp.TaskScheduling
{
    /// <summary>
    /// 制样任务
    /// </summary>
    public class SamplePreparationTask : Entity<string>
    {
        /// <summary>
        /// 制样码
        /// </summary>
        public string SampleCode { get; set; }

        /// <summary>
        /// 任务下达时间
        /// </summary>
        public DateTime TaskAssgnTime { get; set; }

        /// <summary>
        /// 制样方式
        /// </summary>
        public string? SampeWay { get; set; }

        /// <summary>
        /// 任务接收时间
        /// </summary>
        public DateTime? TaskRecptTime { get; set; }

        /// <summary>
        /// 最后操作时间
        /// </summary>
        public DateTime LastOperTime { get; set; }

        /// <summary>
        /// 任务状态
        /// </summary>
        public string ExecStas { get; set; }

        public SamplePreparationTask()
        { 
        
        }

        public SamplePreparationTask(string id, string sampleCode)
        { 
            Id = id;
            SampleCode = sampleCode;
            SampeWay = "自动";
            LastOperTime = TaskAssgnTime = DateTime.Now;
            ExecStas = "就绪";
        }

        public void ReSet(string sampleCode)
        {
            SampleCode = sampleCode;
            LastOperTime = TaskAssgnTime = DateTime.Now;
            ExecStas = "就绪";
        }
    }
}
